﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.IO;

namespace SAR
{
	public partial class TestPage
	{
		public TestPage()
		{
			this.InitializeComponent();

			// 在此点之下插入创建对象所需的代码。
            this.Loaded += new RoutedEventHandler(TestPage_Loaded);
		}

        void TestPage_Loaded(object sender, RoutedEventArgs e)
        {
            ////坐标表示的范围
            //this.sarChart.SARXStart = 16;
            //this.sarChart.SARXEnd = 32;
            //this.sarChart.SARYStart = 2.6;
            //this.sarChart.SARYEnd = 3.4;

            ////画刻度，参数刻度间的间隔
            //this.sarChart.SARDrawXMark(1);
            //this.sarChart.SARDrawYMark(0.1);

            ////画刻度值
            //this.sarChart.SARDrawXText(2, "");
            //this.sarChart.SARDrawYText(0.1, "");

            ////花曲线
            //this.sarChart.SARDrawDataPoint(17, 2.8, Colors.Red);
            //this.sarChart.SARDrawLine(17, 2.8, 19, 3.0, 2, Colors.Red);
            //this.sarChart.SARDrawDataPoint(19, 3.0, Colors.Red);
            //this.sarChart.SARDrawLine(19, 3.0, 21, 3.2, 2, Colors.Red);
            //this.sarChart.SARDrawDataPoint(21, 3.2, Colors.Red);
            //this.sarChart.SARDrawLine(21, 3.2, 23, 2.9, 2, Colors.Red);
            //this.sarChart.SARDrawDataPoint(23, 2.9, Colors.Red);
            //this.sarChart.SARDrawLine(23, 2.9, 25, 2.7, 2, Colors.Red);
            //this.sarChart.SARDrawDataPoint(25, 2.7, Colors.Red);

            //this.sarChart.SARDrawDataPoint(17, 2.6, Colors.Yellow);
            //this.sarChart.SARDrawLine(17, 2.6, 19, 2.8, 2, Colors.Yellow);
            //this.sarChart.SARDrawDataPoint(19, 2.8, Colors.Yellow);
            //this.sarChart.SARDrawLine(19, 2.8, 21, 3.1, 2, Colors.Yellow);
            //this.sarChart.SARDrawDataPoint(21, 3.1, Colors.Yellow);
            //this.sarChart.SARDrawLine(21, 3.1, 23, 2.7, 2, Colors.Yellow);
            //this.sarChart.SARDrawDataPoint(23, 2.7, Colors.Yellow);
            //this.sarChart.SARDrawLine(23, 2.7, 25, 3.2, 2, Colors.Yellow);
            //this.sarChart.SARDrawDataPoint(25, 3.2, Colors.Yellow);

            ////画注释
            //this.sarChart.SARDrawComment(25, 3.2, "1");
        }

        private void SARImageButton_SARClick(object sender, MouseButtonEventArgs e)
        {
            byte[] bts =  this.sarChart.getImage();
            FileStream fs = new FileStream("c:\\123.png",FileMode.Create);
            fs.Write(bts,0,bts.Length);
            fs.Close();
            fs.Dispose();

        }
	}
}